fix(docs): prerender every docs page - #202
Conversation
The docs site prerendered only the home page, so opening or refreshing any other URL on a host with a fallback to index.html showed the home page until Angular loaded and swapped in the real page. It now prerenders every page and a 404.html from the route list the sitemap uses, taken from the same fix in NgMd.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe documentation site now shares route discovery across prerendering and sitemap generation. The route list includes API symbol routes, tracks ChangesDocumentation site routes
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Analog
participant prerenderRoutes
participant siteRoutes
participant apiRoutes
Analog->>prerenderRoutes: Request prerender routes
prerenderRoutes->>siteRoutes: Collect site routes
siteRoutes->>apiRoutes: Get API routes
apiRoutes-->>siteRoutes: Return API routes and source files
siteRoutes-->>prerenderRoutes: Return sorted page, content, and API routes
prerenderRoutes-->>Analog: Return routes with /404.html
Merge Risk: ⚪ Minimal · up to No actionable issue identified here prevents merging after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
A rabbit maps the pages with care Comment |
|
View your CI Pipeline Execution ↗ for commit c7e1c23
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
The docs site prerendered only the home page, so opening or refreshing any other docs URL showed the home page until Angular loaded and swapped in the real page. This takes the same fix as NgMd (erkamyaman/ngmd@08dbcae):
plugin-utils.ts:siteRoutes()andprerenderRoutes()list every page, content page and API symbol page in one placevite.config.ts: passesprerender.routesto Analog, so the build writes an HTML file per page plus404.htmlsitemap.plugin.tsandapi-gen.plugin.ts: use the same route list as the prerender stepWhen the site is deployed, the host should serve
404.htmlfor unknown paths rather than rewriting every path toindex.html, or the home page shows up again.Checks
pnpm docs:build: 37 HTML files (34 docs pages,/,/sponsorsand404.html) and 35 sitemap entries; each page has its own title (for exampleAngular DevTools | Router)pnpm format:checkandpnpm skills:checkpassSummary by CodeRabbit
noIndexare excluded from the sitemap, while existing routes are preserved when a content page is markednoIndex.